<?php defined('IN_IA') or exit('Access Denied');?><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<avalon ms-skip="" class="avalonHide">
<style id="avalonStyle">
.avalonHide{ display: none!important }
</style>
</avalon>
<title>地址管理</title>
  <meta charset="utf-8">   
  <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
  <meta name="format-detection" content="telephone=no">
  <meta http-equiv="Pragma" content="no-cache">   
  <meta http-equiv="Cache-Control" content="no-store">
  <meta http-equiv="Expires" content="0">
  <link href="../addons/feng_fightgroups/template/css/style_366c9ef.css" rel="stylesheet"> 
  <link href="../addons/feng_fightgroups/template/css/my.css" rel="stylesheet">  
  <link  href="../addons/feng_fightgroups/template/css/font-awesome-4.3.0/css/font-awesome.min.css" rel="stylesheet">
  <script src="../addons/feng_fightgroups/template/js/jquery.min.js"></script>
  <style>
  .address_list .edit::after,.address_list ul::before{background-image:url(http://static.paipaiimg.com/fd/qqpai/base/img/sprites_v3.png);background-repeat:no-repeat;background-size:100px 100px}
  </style>
</head> 
<body>
<div class="wx_bar">
  <div class="wx_bar_back"><a id="listPageback" href="javascript:void(0);"></a></div>
  <div class="wx_bar_act"><a class="wx_bar_new" id="_new" style="display: none;" href="javascript:void(0);"></a>         </div>
</div>
<div class="wx_wrap">
  <div class="address_list" id="addressList" style="opacity: 1; -webkit-transform: scale(1, 1); -webkit-transform-origin: 0px 0px;">
  <?php  if(!empty($address)) { ?>
  <div>
    <div class="address">
    <?php  if(is_array($address)) { foreach($address as $addres) { ?>
    <?php  if($addres['status'] == 1) { ?>
        <ul style="background-color: rgb(232, 227, 227);" id="moren<?php  echo $addres['id'];?>" >
        <i class="fa fa-check-circle" style="background-position: -20px -50px; left: 15px; top: 53%; width: 25px; height: 50px; margin-top: -7px; position: absolute;color : red; font-size: 18px;" id='circle1'></i>
          <li><font color="black"><?php  echo $addres['detailed_address'];?></font></li>
          <li><strong><font color="black"><?php  echo $addres['cname'];?></font></strong>&nbsp&nbsp&nbsp<font color="black"><?php  echo $addres['tel'];?></font></li>
          <li style="display: none;"><?php  echo $addres['id'];?></li>
          <a href="<?php  echo $this->createMobileUrl('createadd',array('op'=>'display','id'=>$addres['id'],'groupnum'=>$all['groupnum'],'g_id'=>$all['g_id']));?>">
          <li class="edit" ms-click="edit">编辑</li>
					</a>
          </ul>
      <?php  } else { ?>
      <ul id="moren<?php  echo $addres['id'];?>" >
      
        <i class="fa fa-circle-o" style="background-position: -20px -50px; left: 15px; top: 53%; width: 25px; height: 50px; margin-top: -7px; position: absolute; color : black ;font-size: 18px;" id='circle2'></i>
          <li><font color="black"><?php  echo $addres['detailed_address'];?></font></li>
          <li><strong><font color="black"><?php  echo $addres['cname'];?></font></strong>&nbsp&nbsp&nbsp<font color="black"><?php  echo $addres['tel'];?></font></li>
          <li style="display: none;" id="addresschange"><?php  echo $addres['id'];?></li>
          <a href="<?php  echo $this->createMobileUrl('createadd',array('op'=>'display','id'=>$addres['id'],'groupnum'=>$all['groupnum'],'g_id'=>$all['g_id']));?>">
          <li class="edit" ms-click="edit">编辑</li>
          </a>
      </ul>
    <?php  } ?>
    <script>
<?php  if($all) { ?>
	 $("#moren<?php  echo $addres['id'];?>").bind("click", function() { 
     $.post('<?php  echo $this->createMobileUrl('createadd',array('op'=>'moren','id'=>$addres['id']))?>',function(m){
                if(m==1){
                  location.href='<?php  echo $this->createMobileUrl('orderconfirm',array('groupnum'=> $all['groupnum'],'id'=>$all['g_id']));?>';                   
                }
                if(m==2){
                    alert('请先填写地址！');
                }
                if(m==0){
                   alert('设置默认失败'); 
                }
             },"html");
          

  });
  <?php  } ?>
</script>
    <?php  } } ?>
    </div>
  </div>
  <?php  } ?> 
    <div class="address_list_link">
    <a class="item item_new"  href="<?php  echo $this->createMobileUrl('createadd');?>">新增收货地址</a>
    <a class="item item_wx" id="selAddrFromWx" style="display: none;" href="javascript:void(0);">从微信选择地址</a> 
    </div>
    <div class="margin_footer"></div>
  </div>
</div>
<?php  if($this->module['config']['mode'] == 1) { ?>
<!-- <footer class="footer">
    <nav>
      <ul>
        <li><a class="nav-controller" href="<?php  echo $this->createMobileUrl('index');?>"><i class="fa fa-home"></i>首页</a></li>
        <li><a class="nav-controller" href="<?php  echo $this->createMobileUrl('mygroup')?>"><i class="fa fa-group"></i>我的团</a></li>
        <li><a class="nav-controller" href="<?php  echo $this->createMobileUrl('myorder')?>"><i class="fa fa-list"></i>我的订单</a></li>
        <li><a class="nav-controller active" href="<?php  echo $this->createMobileUrl('person');?>">
        <i class="fa fa-user"></i>个人中心</a></li>
      </ul>
  </nav>
</footer> -->
<?php  } else { ?>
<!-- <?php (!empty($this) && $this instanceof WeModuleSite) ? (include $this->template('footerbar', TEMPLATE_INCLUDEPATH)) : (include template('footerbar', TEMPLATE_INCLUDEPATH));?> -->
<?php  } ?>
</body>
</html>
